#include <iostream>
#include <string>
#include <vector>
using namespace std;

std::vector<string> frame(const std::vector<string> & v){
	int maxlength=0;
	for (auto i:v){
		if (i.length()>maxlength) maxlength=i.length();
	}
	vector<string> result;
	string line;
	string stars(maxlength+4,'*');
	result.push_back(stars);
	for (auto i:v){
		string spaces(maxlength-i.length()+1,' ');
		// cout<<i<<endl;
		// cout<<spaces<<endl;
		line="* "+i+spaces+"*";
		//cout<<line<<endl;
		result.push_back(line);
		line.clear();
	}
	result.push_back(stars);
	return result;
	
}

int main() 
{ 
	//TODO
	vector<string> result;
	string str;
	getline(cin, str);
	while (str.length()>0){
		result.push_back(str);
		getline(cin,str);
	}
	// for (auto word:result){
	// 	cout<<word<<endl;
	// }
	vector<string> words = frame(result);
    for (auto word:words){
		cout<<word<<endl;
	}
	return 0; 
}
